<template>
  <div>
    <!-- 图标导航 -->
    <van-grid :column-num="channelArr.length">
      <van-grid-item
        v-for="i in channelArr"
        :key="i.id"
        :icon="i.icon_url"
        :text="i.name"
        @click="DIanDi(i.id)"
      />
    </van-grid>
  </div>
</template>

<script>
export default {
  name: "Grid",
  props: ["channelArr"],
  data() {
    return {};
  },
  created() {
    // console.log(this);
  },
  methods: {
    DIanDi(id) {
      this.$router.push({
        name: "channel",
        query: { id },
      });
    },
  },
};
</script>

<style lang='less' scoped>
</style>